package untiring.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import untiring.interfaces.BoardDAO;
import untiring.interfaces.BoardService;
import untiring.interfaces.MemberDAO;
import untiring.interfaces.MemberService;
import untiring.models.BoardVO;
import untiring.models.MemberVO;

@Service("BoardService") 
public class BoardServiceImpl implements BoardService{
	
	@Autowired
	private BoardDAO boardDAO;
	
	@Override
	public String newBoard(BoardVO b) {
		String viewPage = "board/write";
		if(boardDAO.insertBoard(b))viewPage = "redirect:/board/list.mvc";
		return viewPage;
	}

	@Override
	public List<BoardVO> readBoard() {
		
		return boardDAO.selectBoard();
	}

	@Override
	public BoardVO readOneBoard(String bno) {
		return boardDAO.selectOneBoard(bno);
	}

	@Override
	public String modifyBoard(BoardVO b) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String removeBoard(String bno) {
		// TODO Auto-generated method stub
		return null;
	}

	
	

	

	

}
